// index.js
var canvas = null;
function main() {
    canvas = document.getElementById('album');
    // 这里的宽高按实际情况设置
    canvas.width = 375;
    canvas.height = 667;
    stage = new Stage(canvas);
    this.stage.start();

    for (let i = 0; i < 16; i++) {
        let ball = new Billiards(i);
        this.stage.addChild(ball);
        ball.x = (i % 4) * 70 + 50;
        ball.y = Math.floor(i / 4) * 100 + 100;

        ball.scrollSpeed = (i + 1);

        let ax = i % 4;
        let ay = Math.floor(i / 4);

        let az = Math.sqrt(18 - ax * ax - ay * ay);
        let len = Math.sqrt(18);

        ball.scrollAxis = { x: ax / len, y: ay / len, z: az / len };
        console.log(ball.scrollAxis);
    }
}